FragmentActivity

Base class for activities that want to use the support-based Fragments.

Known limitations:

  • When using the <fragment> tag, this implementation can not use the parent view's ID as the new fragment's ID. You must explicitly specify an ID (or tag) in the <fragment>.

Constructors

Link copied to clipboard
constructor()
Default constructor for FragmentActivity.
constructor(@LayoutRes contentLayoutId: Int)
Alternate constructor that can be used to provide a default layout that will be inflated as part of super.onCreate(savedInstanceState).

Functions

Link copied to clipboard
open fun dump(@NonNull prefix: String, @Nullable fd: FileDescriptor, @NonNull writer: PrintWriter, @Nullable args: Array<String>)
Print the Activity's state into the given stream.
Link copied to clipboard
Return the FragmentManager for interacting with fragments associated with this activity.
Link copied to clipboard
Called when a fragment is attached to the activity.
Link copied to clipboard
open fun onCreateView(@NonNull name: String, @NonNull context: Context, @NonNull attrs: AttributeSet): View
open fun onCreateView(@Nullable parent: View, @NonNull name: String, @NonNull context: Context, @NonNull attrs: AttributeSet): View
Link copied to clipboard
open fun onMenuItemSelected(featureId: Int, @NonNull item: MenuItem): Boolean
Link copied to clipboard
open fun onRequestPermissionsResult(requestCode: Int, @NonNull permissions: Array<String>, @NonNull grantResults: Array<Int>)
Link copied to clipboard
open fun onStateNotSaved()
Hook in to note that fragment state is no longer saved.
Link copied to clipboard
When makeSceneTransitionAnimation was used to start an Activity, callback will be called to handle shared elements on the launched Activity.
Link copied to clipboard
When makeSceneTransitionAnimation was used to start an Activity, listener will be called to handle shared elements on the launching Activity.
Link copied to clipboard
open fun startActivityFromFragment(@NonNull fragment: Fragment, @NonNull intent: Intent, requestCode: Int)
open fun startActivityFromFragment(@NonNull fragment: Fragment, @NonNull intent: Intent, requestCode: Int, @Nullable options: Bundle)
Called by Fragment.startActivityForResult() to implement its behavior.
Link copied to clipboard
open fun startIntentSenderFromFragment(@NonNull fragment: Fragment, @NonNull intent: IntentSender, requestCode: Int, @Nullable fillInIntent: Intent, flagsMask: Int, flagsValues: Int, extraFlags: Int, @Nullable options: Bundle)
Called by Fragment.startIntentSenderForResult() to implement its behavior.
Link copied to clipboard
Reverses the Activity Scene entry Transition and triggers the calling Activity to reverse its exit Transition.
Link copied to clipboard
Support library version of invalidateOptionsMenu.
Link copied to clipboard
Support library version of postponeEnterTransition that works only on API 21 and later.
Link copied to clipboard
Support library version of startPostponedEnterTransition that only works with API 21 and later.